using System;
using System.Collections.Generic;

namespace ClieOp.Record
{
    internal class FieldLayout : Dictionary<FieldName, Field>
    {
        public FieldLayout() {}

        public FieldLayout(FieldLayout fieldLayout)
        {
            foreach (var kvp in fieldLayout)
            {
                Add(kvp.Key, kvp.Value);
            }
        }

        public long Recordcode
        {
            get { return Convert.ToInt64(this[FieldName.Recordcode].Value); }
        }

        public void Add(Field field)
        {
            Add(field.Name, field);
        }
    }
}